import { request, config } from 'utils'

const { api } = config
const { transactionReceiptQuery, transactionReceiptQueryAll, transactionReceiptDelete, transactionReceiptAdd, transactionReceiptUpdate, transactionReceiptArrivesUpdate, transactionReceiptArrivesDelete, customerNumber, transactionReceiptList } = api
const { transactionReceiptArrive, transactionReceiptArrived, transactionReceiptReport, transactionReceiptReported, transactionReceiptPay, transactionReceiptPayOk, transactionReceiptPaysUpdate, transactionReceiptPaysDelete, transactionReceiptAddArriveThree } = api

export async function query (params) {
  return request({
    url: transactionReceiptQuery,
    method: 'put',
    data: params,
  })
}
export async function querylist (params) {
  return request({
    url: transactionReceiptList,
    method: 'put',
    data: params,
  })
}
export async function queryAll (params) {
  return request({
    url: transactionReceiptQueryAll,
    method: 'put',
    data: params,
  })
}
export async function create (params) {
  return request({
    url: transactionReceiptAdd,
    method: 'post',
    data: params,
  })
}

export async function remove (params) {
  return request({
    url: transactionReceiptDelete,
    method: 'delete',
    data: params,
  })
}

export async function removeArrive (params) {
  return request({
    url: transactionReceiptArrivesDelete,
    method: 'put',
    data: params,
  })
}

export async function removePay (params) {
  return request({
    url: transactionReceiptPaysDelete,
    method: 'post',
    data: params,
  })
}
export async function update (params) {
  return request({
    url: transactionReceiptUpdate,
    method: 'put',
    data: params,
  })
}

export async function updateArrive (params) {
  return request({
    url: transactionReceiptArrivesUpdate,
    method: 'put',
    data: params,
  })
}
export async function updatePay (params) {
  return request({
    url: transactionReceiptPaysUpdate,
    method: 'post',
    data: params,
  })
}
export async function arrive (params) {
  return request({
    url: transactionReceiptArrive,
    method: 'put',
    data: params,
  })
}

export async function arrived (params) {
  return request({
    url: transactionReceiptArrived,
    method: 'put',
    data: params,
  })
}

export async function pay (params) {
  return request({
    url: transactionReceiptPay,
    method: 'post',
    data: params,
  })
}

export async function paied (params) {
  return request({
    url: transactionReceiptPayOk,
    method: 'put',
    data: params,
  })
}
export async function report (params) {
  return request({
    url: transactionReceiptReport,
    method: 'post',
    data: params,
  })
}

export async function reported (params) {
  return request({
    url: transactionReceiptReported,
    method: 'put',
    data: params,
  })
}

export async function getNumber (params) {
  return request({
    url: customerNumber,
    method: 'put',
    data: params,
  })
}

export async function addArriveThree (params) {
  return request({
    url: transactionReceiptAddArriveThree,
    method: 'put',
    data: params,
  })
}